<!doctype html>
<html lang="en">
<head>
    <!--    页面meta-->
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>传智健康</title>
    <meta name="description" charset="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <!--    引入样式-->
    <link rel="stylesheet" href="../css/style.css">
    <script src="../node_modules/echarts/dist/echarts.js"></script>


</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析<small>套餐占比</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>套餐占比</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">

            <div id="chart1" style="height:600px;"></div>
        </div>
    </div>
</div>
</body>
<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
<!--<div id="chart1" style="width: 600px;height:400px;"></div>-->
<!--组件库-->
<script src="../js/vue.js"></script>
<script src="../js/axios-0.18.0.js"></script>
    <script>

    var myChart1 = echarts.init(document.getElementById('chart1'));

    // 使用刚指定的配置项和数据显示图表。
    //myChart.setOption(option);

    axios.get("/report/getSetmeal.do").then((res)=>{
        myChart1.setOption(
            {
                tooltip: {
                    trigger: 'item',
                    formatter: "{a} <br/>{b}: {c} ({d}%)"
                },
                legend: {
                    orient: 'vertical',
                    x: 'left',
                    data:['0-18','18-30','30-45','45以上','其他']
                },
               /* '联盟广告','视频广告','百度','谷歌','必应',*/
                series: [
                    {
                        name:'访问来源',
                        type:'pie',
                        selectedMode: 'single',
                        radius: [0, '30%'],

                        label: {
                            normal: {
                                position: 'inner'
                            }
                        },
                        labelLine: {
                            normal: {
                                show: false
                            }
                        },
                        data:[
                            {value:500, name:'女', selected:true},
                            {value:600, name:'男'},

                        ]
                    },
                    {
                        name:'访问来源',
                        type:'pie',
                        radius: ['40%', '55%'],
                        label: {
                            normal: {
                                formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                                backgroundColor: '#eee',
                                borderColor: '#aaa',
                                borderWidth: 1,
                                borderRadius: 4,
                                // shadowBlur:3,
                                // shadowOffsetX: 2,
                                // shadowOffsetY: 2,
                                // shadowColor: '#999',
                                // padding: [0, 7],
                                rich: {
                                    a: {
                                        color: '#999',
                                        lineHeight: 22,
                                        align: 'center'
                                    },
                                    // abg: {
                                    //     backgroundColor: '#333',
                                    //     width: '100%',
                                    //     align: 'right',
                                    //     height: 22,
                                    //     borderRadius: [4, 4, 0, 0]
                                    // },
                                    hr: {
                                        borderColor: '#aaa',
                                        width: '100%',
                                        borderWidth: 0.5,
                                        height: 0
                                    },
                                    b: {
                                        fontSize: 16,
                                        lineHeight: 33
                                    },
                                    per: {
                                        color: '#eee',
                                        backgroundColor: '#334455',
                                        padding: [2, 4],
                                        borderRadius: 2
                                    }
                                }
                            }
                        },
                        data:[
                            {value:335, name:'0-18'},
                            {value:310, name:'18-30'},
                            {value:234, name:'30-45'},
                            {value:135, name:'45以上'},
                            /*{value:1048, name:'百度'},
                            {value:251, name:'谷歌'},
                            {value:147, name:'必应'},*/
                            {value:102, name:'其他'}
                        ]
                    }
                ]

            });
    });
</script>
</html>